import request from "@/utils/request";
// 阿米巴预算 预算单元

// 查询预算公式列表 /tool/budgetUnit/list
export const getBudgetUnitListApi = params => {
  return request({
    url: `/tool/budgetUnit/list`,
    method: "GET",
    params
  });
};

// 添加预算单元 /tool/budgetUnit/add
export const addBudgetUnitApi = data => {
  return request({
    url: `/tool/budgetUnit/add`,
    method: "post",
    data
  });
};

// 编辑预算单元 /tool/budgetUnit/edit
export const editBudgetUnitApi = data => {
  return request({
    url: `/tool/budgetUnit/edit`,
    method: "put",
    data
  });
};

// 删除预算单元 /tool/budgetUnit/remove/{id}
export const removeBudgetUnitApi = data => {
  return request({
    url: `/tool/budgetUnit/remove/${data.id}`,
    method: "DELETE"
  });
};

// 获取预算单元列表 /tool/budgetUnit/listWithMember
export const getBudgetUnitListWithMemberApi = params => {
  return request({
    url: `/tool/budgetUnit/listWithMember`,
    method: "get",
    params
  });
};

// 列出预定成员 /tool/budgetUnit/listMemberInfo
export const getListMemberInfoApi = params => {
  return request({
    url: `/tool/budgetUnit/listMemberInfo`,
    method: "get",
    params
  });
};

// 获取已分配预算单元的成员 /tool/budgetUnit/listMemberByServiceId
export const getListMemberByServiceIdApi = params => {
  return request({
    url: `/tool/budgetUnit/listMemberByServiceId`,
    method: "get",
    params
  });
};

// 添加预定成员(覆盖) /tool/budgetUnit/addMemberCover
export const addBudgetUnitMemberApi = data => {
  return request({
    url: `/tool/budgetUnit/addMemberCover`,
    method: "post",
    data
  });
};

// 删除预定成员 /tool/budgetUnit/delMember
export const delBudgetUnitMemberApi = data => {
  return request({
    url: `/tool/budgetUnit/delMember`,
    method: "DELETE",
    data
  });
};

// 添加报销申请 /tool/budgetApply/add
export const addBudgetApplyApi = data => {
  return request({
    url: `/tool/budgetApply/add`,
    method: "post",
    data
  });
};

// 修改报销申请 /tool/budgetApply/edit
export const editBudgetApplyApi = data => {
  return request({
    url: `/tool/budgetApply/edit`,
    method: "put",
    data
  });
};

// 批量修改报销申请 /tool/budgetApply/batchEdit
export const batchEditBudgetApplyApi = data => {
  return request({
    url: `/tool/budgetApply/batchEdit`,
    method: "put",
    data
  });
};

// 查询报销列表的接口 /tool/budgetApply/list
export const getBudgetApplyListApi = params => {
  return request({
    url: `/tool/budgetApply/list`,
    method: "get",
    params
  });
};

// 删除报销申请 /tool/budgetApply/remove/{id}
export const removeBudgetApplyApi = data => {
  return request({
    url: `/tool/budgetApply/remove/${data.id}`,
    method: "DELETE"
  });
};

// 按人员 查询列表 /tool/budgetApply/groupByHandler
export const getGroupByHandlerApi = params => {
  return request({
    url: `/tool/budgetApply/groupByHandler`,
    method: "get",
    params
  });
};

// 按科目 查询列表 /tool/budgetApply/groupBySubject
export const getGroupBySubjectApi = params => {
  return request({
    url: `/tool/budgetApply/groupBySubject`,
    method: "get",
    params
  });
};

// 获取核数人列表 /tool/budgetApply/listCheck
export const getBudgetApplyListCheckApi = params => {
  return request({
    url: `/tool/budgetApply/listCheck`,
    method: "get",
    params
  });
};

// 获取审批进度 /tool/budgetApply/getInfo
export const getInfoBudgetApplyApi = params => {
  return request({
    url: `/tool/budgetApply/getInfo`,
    method: "get",
    params
  });
};

// 获取 我的、确认、核数 的数量 /tool/budgetApply/countApply
export const getBudgetApplyCountApi = params => {
  return request({
    url: `/tool/budgetApply/countApply`,
    method: "get",
    params
  });
};

// 上传图片和文件的接口 /tool/budgetApply/invoiceOcr
export const invoiceOcrBudgetApplyCountApi = data => {
  return request({
    url: `/tool/budgetApply/invoiceOcr`,
    method: "post",
    data
  });
};
//预算单元人看公式的接口/tool/unitPeriod/list
export const unitPeriodListApi = params => {
  return request({
    url: `/tool/unitPeriod/listWithReward`,
    params
  });
};
